package com.wanban.txplayertest

import com.wanban.downloader.db.DownloadEntity

object DataUtils {

    // mp4测试地址
    //    private val url = "http://ftp.zuidaxz.com/202308/26/y9eLie0Pay3/video/1000k_0X720_64k_25/昆仑神宫%20第01集%20720P(准高清)(4390356).mp4" // 配置您的播放视频 url


    private val urls = arrayListOf(
        UrlData("花桥喜事","https://s9.fsvod1.com/20230830/q6INDNEY/index.m3u8", 9, 7),
        UrlData("花桥喜事","https://pptv.sd-play.com/202308/30/qp6FpK73hB3/video/index.m3u8", 10, 7),
        UrlData("花桥喜事","https://vod6.bdzybf7.com/20230830/DMMH4zQ6/index.m3u8", 8,7),
        UrlData("花桥喜事","http://lfapi.newtvmedia.link/video_cache/jiexi/5629a37696db49cbd2bb87df82007ff9.m3u8", 7,7),
        UrlData("花桥喜事","https://v9.dious.cc/20230830/9iOYlxkB/index.m3u8", 6,7),
        UrlData("花桥喜事","https://hnzy.bfvvs.com/play/QeZRlQEe/index.m3u8", 4,7),
        UrlData("花桥喜事","https://m3u8.mstopq.com/202308/30/SjnjU41JML1/video/index.m3u8", 3,7),
        UrlData("花桥喜事","https://top.qoqkkhy.com/202308/30/EgE0eAaD4r3/video/index.m3u8", 2,7),
        UrlData("花桥喜事","https://cdn16.vipyz-cdn1.com/20230830/18836_7a80331c/index.m3u8", 1,7),
        UrlData("花桥喜事","http://tlapi.newtvmedia.link/fengyu/m3u8/1d6e73a5eec77295e21057405203341b.m3u8", 32,3),
        UrlData("花桥喜事","http://tlapi.newtvmedia.link/fengyu/m3u8/e460940908bc5df2b16cedf976a870f6.m3u8", 31,5),
        UrlData("花桥喜事","https://hd.ijycnd.com/play/zbq9Jo2b/index.m3u8", 111,5),
        UrlData("花桥喜事","https://v.gsuus.com/play/xboPEmjd/index.m3u8", 18,5),
        UrlData("花桥喜事","https://vod2.kczybf.com/20230829/Y2Zhc0Gk/index.m3u8", 16,5),
        UrlData("花桥喜事","https://1080p.sbzyplay.com/play/mepPGn2e/index.m3u8", 15,5),
        UrlData("花桥喜事","http://lfapi.newtvmedia.link/video_cache/jiexi/cde7db8bccea85c95d4aa44d30e768a5.m3u8", 13,5),
        UrlData("花桥喜事","https://ukzy.ukubf4.com/20230829/ySciBtzJ/index.m3u8", 12,5),
        UrlData("花桥喜事","https://1080p.huyall.com/play/zbq9Jo2b/index.m3u8", 11,5),
    )

    fun initDownloadData(): ArrayList<DownloadEntity>{
        val tasks = ArrayList<DownloadEntity>()
        val videoIdStartIndex = 1000L
        urls.forEachIndexed { index, data ->
            val item = DownloadEntity()
            item.url = data.url
            item.videoName = data.videoName
            // 新建下载任务
            item.videoId = videoIdStartIndex + index
            item.sourceId = data.sourceId
            item.episode = data.episode
            item.episodeName = "第${data.episode + 1}集"
            // 下载
           tasks.add(item)
        }
        return tasks
    }

    class UrlData(
        val videoName: String,
        val url: String,
        val sourceId: Int,
        val episode: Int
    )
}